package com.cancer.controller.weixin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cancer.biz.weixin.service.VMenuService;
import com.cancer.common.web.APIModel;

/**
 * 自定义菜单
 * @author baizhaoming
 *
 */
@Controller
@RequestMapping("/api_v1/vmenu")
public class DefinedMenuController {

	@Autowired
	private VMenuService vMenuService;
	/**
     * 创建自定义菜单
     * @return
     */
    @RequestMapping(value = "/createMenu", method = {RequestMethod.POST })
    @ResponseBody
	public Object createMenu(@RequestBody String jsonMenu){
    	APIModel model = new APIModel();
    	if(vMenuService.createMenu(jsonMenu)){
    		model.set(0, "success", null);
    	}else{
    		model.set(1, "fail", null);
    	}
    	return model;
	}
}
